/*    */ package openmyexplorer.util;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.io.InputStream;
/*    */ import java.io.InputStreamReader;
/*    */ import java.io.Reader;
/*    */ import java.io.StringWriter;
/*    */ import java.io.Writer;
/*    */ 
/*    */ public class IOUtils
/*    */ {
/*    */   private static final int DEFAULT_BUFFER_SIZE = 4096;
/*    */ 
/*    */   public static long copyLarge(Reader input, Writer output)
/*    */     throws IOException
/*    */   {
/* 43 */     char[] buffer = new char[4096];
/* 44 */     long count = 0L;
/* 45 */     int n = 0;
/* 46 */     while (-1 != (n = input.read(buffer))) {
/* 47 */       output.write(buffer, 0, n);
/* 48 */       count += n;
/*    */     }
/* 50 */     return count;
/*    */   }
/*    */ 
/*    */   public static int copy(Reader input, Writer output) throws IOException {
/* 54 */     long count = copyLarge(input, output);
/* 55 */     if (count > 2147483647L) {
/* 56 */       return -1;
/*    */     }
/* 58 */     return (int)count;
/*    */   }
/*    */ 
/*    */   public static void copy(InputStream input, Writer output) throws IOException
/*    */   {
/* 63 */     InputStreamReader in = new InputStreamReader(input);
/* 64 */     copy(in, output);
/*    */   }
/*    */ 
/*    */   public static String toString(InputStream input) throws IOException {
/* 68 */     StringWriter sw = new StringWriter();
/* 69 */     copy(input, sw);
/* 70 */     return sw.toString();
/*    */   }
/*    */ }

/* Location:           F:\Eclipse2020\eclipse\dropins\OpenExplorer_1.5.0.v201108051513.jar
 * Qualified Name:     openexplorer.util.IOUtils
 * JD-Core Version:    0.6.2
 */